//
//  Caculator.m
//  链式编程01
//
//  Created by 许卫星 on 16/12/26.
//  Copyright © 2016年 许卫星. All rights reserved.
//

#import "Caculator.h"

@implementation Caculator

/**加法**/
- (Caculator *(^)(int index))add
{
    return ^Caculator *(int index){
        self.result += index;
        return self;
    };
}
/**减法**/
- (Caculator *(^)(int index))reduction
{
    return ^Caculator *(int index){
        self.result -= index;
        return self;
    };
}
/**乘法**/
- (Caculator *(^)(int index))multiplication
{
    return ^Caculator *(int index){
        self.result *= index;
        return self;
    };
}
/**除法**/
- (Caculator *(^)(int index))division
{
    return ^Caculator *(int index){
        self.result /= index;
        return self;
    };
}

- (Caculator *(^)(int index))equle
{
    return ^Caculator *(int index){
        self.isEqule = index == self.result;
        return self;
    };
}
@end
